# -*- coding: utf-8 -*-
import KBEngine

from logic.engine.ExeFlowModule import ExeFlowModule
from logic.HallModule import HallModule
from logic.RoomModule import RoomModule
from logic.NameModule import NameModule
from logic.ItemModule import ItemModule
from logic.PlayModule import PlayModule
from logic.MailModule import MailModule
from logic.CapitalModule import CapitalModule
from logic_common.ContainerHandler import ContainerHandler

# 调试看值来源
# KBEngine.entities[1].IKernel.moduleMgr.allModule

def Instance():
	return ModuleMgr.instance

class ModuleMgr:
	instance = None

	def __init__(self):
		ModuleMgr.instance = self

		self.allModule = {
			"ExeFlowModule"			: ExeFlowModule(),# 专门用来监听引擎代理执行流程的模块
			"HallModule"			: HallModule(),
			"RoomModule"			: RoomModule(),
			"NameModule"			: NameModule(),
			"ItemModule"			: ItemModule(),
			"PlayModule"			: PlayModule(),
			"MailModule"			: MailModule(),
			"CapitalModule"			: CapitalModule(),
			"ContainerHandler"		: ContainerHandler(),
		}

	def init(self, isReload):
		for modName, modInst in self.allModule.items():
			modInst.init(isReload)

	def end(self):
		for modName, modInst in self.allModule.items():
			modInst.end()

	def getModule(self, moduleName):
		return self.allModule.get(moduleName)







































































































